Fix XLSX reader when having a corrupt numeric cell data type #1664
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is:
Checklist:
Why this change is needed?
In some rare cases, when reading an XLSX file that may contain invalid cell type values, the reader throw an error. It happens when the found data type in a table cell is numeric, but the actual value is an empty string. This will throw a exception and the result is the file cannot be read.
You can open those files in any reader (LibreOffice, MS Office) without problems but PhpSpreadsheet struggles with it.
Unfortunetely i cannot add tests or a demonstration file because our files that cause this error contains sensible data. If we try to remove the sensible data, the file is automatically fixed by our Office Suite. The file we use is generated from a third party company, so we have no chance to generate files with those errors.
Hopefully this PR will be merged even if no test scenario is provided.